import Vue from "vue"
import Vuex from "vuex"

Vue.use(Vuex);

export default new Vuex.Store({
    state:{
        token: window.sessionStorage.getItem("token"),
        isAdmin:false
    },
    mutations:{
        saveToken(state,token){
            state.token = token;
            window.sessionStorage.setItem("token",token)
        },
        saveIsAdmin(state,isAdmin){
            state.isAdmin=isAdmin;
        },
    }
})
